package com.baiyangtx.lingerweather.data;

import com.baiyangtx.lingerweather.adapt.CityKey;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class CityDataOpenHelper extends SQLiteOpenHelper {

	public static final int VERSION = 1 ;
	public static final String DATABASE_NAME = "linger_city.db" ;
	
	public static final String TABLE_NAME = "user_city" ;
	
	
	public static final String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS " 
			+ TABLE_NAME + "("
			+ CityKey.CITY_CODE + " TEXT PRIMARY KEY , "
			+ CityKey.CITY_NAME + " TEXT , " 
			+ CityKey.SYNC_TIME + " TEXT , "
			+ CityKey.REAL_TEMPERATURE 	  + " TEXT , "
			+ CityKey.RECENT_WEATHER      + " TEXT , "
			+ CityKey.FEELING             + " TEXT , " 
			+ CityKey.FEELING_DESCRIPTION + " TEXT , " 
			+ CityKey.FUTURE_TEMP_HIGHT   + " TEXT , "
			+ CityKey.FUTURE_TEMP_LOW     + " TEXT , "
			+ CityKey.FUTURE_WEATHER_NIGHT+ " TEXT , "
			+ CityKey.FUTURE_WEATHER_NOON + " TEXT , "
			+ CityKey.WIND       + " TEXT , " 
			+ CityKey.WIND_POWER + " TEXT  "
			+ " ) "
			;
	
	public CityDataOpenHelper(Context context) {
		super( context , DATABASE_NAME , null, VERSION ) ;
	}
	

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_TABLE) ;
	}


	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		
	}

	
}
